package acwing.周赛;/**
 * @author： li
 * @date： 2022-04-02 19:07
 * @version 1.0
 */
import java.util.*;
public class 最长连续子序列 {
    static int[] a;
    static int n,k;
    static int check(int l,int r){
        HashSet<Integer> hashSet = new HashSet<>();
            for(int i=l;i<=r;i++)
                hashSet.add(a[i]);
                return hashSet.size();
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n=sc.nextInt();
        k=sc.nextInt();
        a = new int[n+1];
        for(int i=1;i<=n;i++)
            a[i]=sc.nextInt();
        int f[][] = new int[n+1][n+1];
        int max=Integer.MIN_VALUE;
        int l =0,r =0;
        for(int i=1;i<=n;i++) {
            for (int j = n; j>=1; j--) {
                f[i][j] =check(i,j);
                if(j-i>max&&f[i][j]==k){
                    l=i;
                    r=j;
                    max=Math.max(max,j-i);
                }
                if(f[i][j]<k)
                    break;
            }
        }
        System.out.println(l+" "+r);

    }
}
